package com.zhongyu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongyu.pojo.LinkUser;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IReportMapper  {
    //销售统计报表
    @Select("SELECT gt.type1,sum(ol.money) as a , o.create_time FROM smbms_goods_type gt,smbms_goods gs,smbms_order_detail ol,smbms_order o\n" +
            "WHERE gt.id=gs.type_id AND ol.goods_id=gs.id AND o.id=ol.order_id AND o.type=2 GROUP BY gt.type1  ${ew.customSqlSegment}")
    @ResultMap("iRm")
    List  ordersReport(@Param("ew") Wrapper wrapper);
}
